// JavaScript Document
$(document).ready(function(e) {
	var W=$(window).width();
	var H=$(window).height();
	var hh=$(".fm").height()+77;
	var ww=$(".fm").width();
	var h,w;
	if(H>hh){
		h=(H-152)/2;
		$(".form_zz").height(H);
		}else{
		h=(hh-152)/2;
		$(".form_zz").height(hh);
		}
	if(W>ww){
		w=(W-302)/2;
		$(".form_zz").width(W);
		}else{
		w=(ww-302)/2;
		$(".form_zz").width(ww);
		}
	if(w>0){
		$(".form_zzcontent").css("left",w);
	}
	if(h>0){
		$(".form_zzcontent").css("top",h);
	}
    $(window).resize(function(e) {
        W=$(window).width();
		H=$(window).height();
		h=(H-152)/2;
		w=(W-302)/2;
		if(H>hh){
			h=(H-152)/2;
			$(".form_zz").height(H);
		}else{
			h=(hh-152)/2;
			$(".form_zz").height(hh);
		}
		if(W>ww){
			w=(W-302)/2;
			$(".form_zz").width(W);
		}else{
			w=(ww-302)/2;
			$(".form_zz").width(ww);
		}
		if(w>0){
			$(".form_zzcontent").css("left",w);
		}
		if(h>0){
			$(".form_zzcontent").css("top",h);
		}
    });
	$(":radio").attr("checked",false);
	$(".fm_rd").hover(function(){
			$(this).css("color","#53b1f1");
		},function(){
			if($(this).hasClass("Is_click")){}else{
			$(this).css("color","#2f2f2f");
			}
		});
    $(".fm_rd").click(function(){
			$(this).css("color","#53b1f1");
			$(this).addClass("Is_click");
			$(".fm_rd").not($(this)).removeClass("Is_click");
			$(".fm_rd").not($(this)).css("color","#2f2f2f");
		});
	$(":radio").click(function(){
		$(this).next(".fm_rd").click();
		});
	$(".fm_img1,.fm_button").hover(function(){
		$(".fm_img1").css("background","url(skin/images/form_hoverimg_03.png) no-repeat");
		$(".fm_img2").css("background","url(skin/images/form_hoverimg_07.png) no-repeat");
		$(".fm_button").css("background","url(skin/images/form_hoverimg_05.png) repeat-x");
		},function(){
		$(".fm_img1").css("background","url(skin/images/form_img_12.png) no-repeat");
		$(".fm_img2").css("background","url(skin/images/form_img_09.png) no-repeat");
		$(".fm_button").css("background","url(skin/images/form_img_07.png) repeat-x")
		});
	$(".fm_img1,.fm_img2,.fm_button").click(function(){
		$(".form_zz").show();
	    });
	$(".form_zzan2").hover(function(){
			$(this).css("background","url(skin/images/form_zz_hovericon_05.png) repeat-x");
			$(".form_zzbt3").css("background","url(skin/images/form_zz_hovericon_03.png) no-repeat");
			$(".form_zzbt4").css("background","url(skin/images/form_zz_hovericon_07.png) no-repeat");
		},function(){
			$(this).css("background","url(skin/images/form_zz_icon_09.png) repeat-x");
			$(".form_zzbt3").css("background","url(skin/images/form_zz_icon_07.png) no-repeat");
			$(".form_zzbt4").css("background","url(skin/images/form_zz_icon_11.png) no-repeat");
		});
	$(".form_zzimg").hover(function(){
			$(this).attr("src","skin/images/form_zz_hoverclose_03.png");
		},function(){
			$(this).attr("src","skin/images/form_zz_icon_03.png");
		});
	$(".form_zzimg,.form_zzan2").click(function(){
		$(".form_zz").hide();
		});
	$(".form_zzan1").hover(function(){
			$(this).css("background","url(skin/images/form_zz_hovericon_05.png) repeat-x");
			$(".form_zzbt1").css("background","url(skin/images/form_zz_hovericon_03.png) no-repeat");
			$(".form_zzbt2").css("background","url(skin/images/form_zz_hovericon_07.png) no-repeat");
		},function(){
			$(this).css("background","url(skin/images/form_zz_icon_09.png) repeat-x");
			$(".form_zzbt1").css("background","url(skin/images/form_zz_icon_07.png) no-repeat");
			$(".form_zzbt2").css("background","url(skin/images/form_zz_icon_11.png) no-repeat");
		});
	$(".form_zzan1").click(function(){
		$(".fm").submit();
		$(".form_zz").hide();
		});
});